Skip to content

[FLINK-38262][table] show connections operation - #28790

Open
Shekharrajak wants to merge 2 commits into
apache:masterfrom
Shekharrajak:FLINK-38262-show-connections-operation
Open

[FLINK-38262][table] show connections operation#28790
Shekharrajak wants to merge 2 commits into
apache:masterfrom
Shekharrajak:FLINK-38262-show-connections-operation

Conversation

@Shekharrajak

@Shekharrajak Shekharrajak commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Adds ShowConnectionsOperation and converter support for SHOW CONNECTIONS, including catalog/database qualification and LIKE filtering.

Ref https://issues.apache.org/jira/browse/FLINK-38262

Brief change log

Add SHOW CONNECTION operation

Verifying this change

Unit tests and IT

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no) no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no) no
  • The serializers: (yes / no / don't know) no
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know) no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know) no
  • The S3 file system connector: (yes / no / don't know) no

Documentation

  • Does this pull request introduce a new feature? (yes / no) yes
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

Was generative AI tooling used to co-author this PR?
  • Yes

@Shekharrajak
Shekharrajak force-pushed the FLINK-38262-show-connections-operation branch from f0455b5 to df55cc1 Compare July 21, 2026 17:10
@flinkbot

flinkbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@snuyanzin snuyanzin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not ignore Contributors form

@raminqaf raminqaf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good. Left a nit

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jul 27, 2026
@Shekharrajak

Copy link
Copy Markdown
Contributor Author

@flinkbot run azure

Comment on lines +82 to +99
void testShowConnections() {
tEnv().executeSql("CREATE TEMPORARY CONNECTION b_conn WITH ('k' = 'v')");
tEnv().executeSql("CREATE TEMPORARY CONNECTION a_conn WITH ('k' = 'v')");

assertThat(collectRows("SHOW CONNECTIONS"))
.containsExactly(Row.of("a_conn"), Row.of("b_conn"));
}

@Test
void testShowConnectionsLike() {
tEnv().executeSql("CREATE TEMPORARY CONNECTION prod_conn WITH ('k' = 'v')");
tEnv().executeSql("CREATE TEMPORARY CONNECTION tmp_conn WITH ('k' = 'v')");

assertThat(collectRows("SHOW CONNECTIONS LIKE 'prod_%'"))
.containsExactly(Row.of("prod_conn"));
assertThat(collectRows("SHOW CONNECTIONS NOT LIKE 'prod_%'"))
.containsExactly(Row.of("tmp_conn"));
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need 2 separate tests?
why same can't be done in one?

SqlShowConnections sqlShowCall,
@Nullable String catalogName,
@Nullable String databaseName,
String prep,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why it is not nullable?


private List<Row> collectRows(String sql) {
TableResult result = tEnv().executeSql(sql);
return CollectionUtil.iteratorToList(result.collect());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you look at javadoc of this method it does not match recommended way to call it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants